# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: kastor <kastor@fobos.org.ar>

_name=pupnp
pkgname=libupnp
pkgver=1.14.12
pkgrel=1
pkgdesc='Portable Open Source UPnP Development Kit'
url="https://pupnp.sourceforge.io/"
arch=('x86_64')
license=('BSD')
depends=('glibc')
makedepends=('cmake')
provides=('libixml.so' 'libupnp.so')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/${_name}/${_name}/archive/release-${pkgver}.tar.gz")
sha512sums=('aab17aa12f15d110bfab20cbcbae5f54926b6ca7a30bce10b9287cd39919a06a5e9f1493405e1d561c0d58ba46926f87009df891e4e4f37097df1c3c67635ca9')
b2sums=('721c10f9fa4ffc60743b4ebf8be566ea595931cb1f2a2448d8e3cecfc787abfb855cb16256eaaa10ce6a901cd5e5b3d14672610841b2a718d5dd003ccfd3c2f0')

prepare() {
  mv -v ${_name}-release-${pkgver} ${pkgname}-${pkgver}
}

build() {
  cd ${pkgname}-${pkgver}
  cmake -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE='None' \
        -Wno-dev \
        -B build \
        -S .
  make VERBOSE=1 -C build
}

check() {
  cd ${pkgname}-${pkgver}
  make VERBOSE=1 -C build test
}

package() {
  cd ${pkgname}-${pkgver}
  make -C build DESTDIR="${pkgdir}" install
  install -vDm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -vDm 644 {ChangeLog,README.md} \
    -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
